<?php

defined('SYSPATH') or die('Access error!');


//商城相关
Route::set('shop', 'shop(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'index'))
        ->defaults(array(
            'controller' => 'shop',
            'action' => 'index',
        ));


//产品相关
Route::set('shop/seller/goods', 'shop/seller/goods(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'add|list|onsale|downsale|recycle|edit'))
        ->defaults(array(
            'directory' => 'shop/seller/',
            'controller' => 'goods',
            'action' => 'add',
        ));



//买家订单相关
Route::set('shop/seller/order', 'shop/seller/order(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'view|list|operate'))
        ->defaults(array(
            'directory' => 'shop/seller/',
            'controller' => 'order',
            'action' => 'list',
        ));

//卖家订单相关
Route::set('shop/buyer/order', 'shop/buyer/order(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'view|list|operate'))
        ->defaults(array(
            'directory' => 'shop/buyer/',
            'controller' => 'order',
            'action' => 'list',
        ));



//卖家订单相关
Route::set('shop/user/goods', 'shop/user/goods(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'comment|reply'))
        ->defaults(array(
            'directory' => 'shop/user/',
            'controller' => 'goods',
            'action' => 'comment',
        ));



//某个用户的店铺管理
Route::set('shop/seller/store', 'shop/seller/store(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'base|theme|save_theme'))
        ->defaults(array(
            'directory' => 'shop/seller/',
            'controller' => 'store',
            'action' => 'base',
        ));
//前台店铺相关
Route::set('store', 'store(/<id>)', array('id' => '\d+',
            'action' => 'user|index'))
        ->defaults(array(
            'controller' => 'store',
            'action' => 'index',
        ));


//产品操作
Route::set('goods', 'goods(/<id>)', array('id' => '\d+'))
        ->defaults(array(
            'controller' => 'goods',
            'action' => 'index',
        ));

//产品操作
Route::set('goods_list', 'goods/list(/<id>)', array('id' => '\d+'))
        ->defaults(array(
            'controller' => 'goods',
            'action' => 'list',
        ));


//订单操作
Route::set('order', 'order(/<id>)', array('id' => '\d+'))
        ->defaults(array(
            'controller' => 'goods',
            'action' => 'submit',
        ));



//ajax
Route::set('shop/ajax', 'shop/ajax(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'category_sub|delete_goods|operate_goods'))
        ->defaults(array(
            'directory' => 'shop',
            'controller' => 'ajax',
            'action' => 'category_sub',
        ));


